package com.honeyms.project.im.socket.domain;

import java.util.List;

import com.honeyms.framework.web.domain.BaseEntity;
import com.honeyms.project.system.user.domain.User;

public class ChatMsg extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 1系统(10上线/11下线/12发给自己)/2用户
	 */
	private int type;
	
	/**
	 * 消息
	 */
	private String msg;
	
	/**
	 * 登录名
	 */
	private String loginName;
	
	/**
	 * 用户头像
	 */
	private String avatar;
	
	/**
	 * 发送时间
	 */
	private String sendtime;
	
	/**
	 * 用户id
	 */
	private Long userId; 
	
	private List<User> users;
	
	public ChatMsg() {
		super();
	}

	public ChatMsg(int type, String msg, String loginName, String avatar, String sendtime, Long userId) {
		super();
		this.type = type;
		this.msg = msg;
		this.loginName = loginName;
		this.avatar = avatar;
		this.sendtime = sendtime;
		this.userId = userId;
	}
	
	public ChatMsg(int type, String msg, String loginName, String avatar, String sendtime, Long userId, List<User> users) {
		super();
		this.type = type;
		this.msg = msg;
		this.loginName = loginName;
		this.avatar = avatar;
		this.sendtime = sendtime;
		this.userId = userId;
		this.users=users;
	}

	public int getType() {
		return type;
	}

	public String getMsg() {
		return msg;
	}

	public String getLoginName() {
		return loginName;
	}

	public String getAvatar() {
		return avatar;
	}

	public String getSendtime() {
		return sendtime;
	}

	public void setType(int type) {
		this.type = type;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public void setSendtime(String sendtime) {
		this.sendtime = sendtime;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	@Override
	public String toString() {
		return "{\"type\":\"" + type + "\", \"msg\":\"" + msg + "\", \"loginName\":\"" + loginName + "\", \"avatar\":\""
				+ avatar + "\", \"sendtime\":\"" + sendtime + "\", \"userId\":\"" + userId + "\"}";
	}

}
